//
//  YMWarnAlter.m
//  YiMiao
//
//  Created by notbadboy on 14/10/21.
//  Copyright (c) 2014年 hylapp.com. All rights reserved.
//

#import "GRWarnAlter.h"

@implementation GRWarnAlter
+ (void)warnCustomerWithMessage:(NSString *)message cancleButtonTitle:(NSString *)cancelString sureBtnTitle:(NSString *)sureString delegate:(id<UIAlertViewDelegate>)delegate
{
    [self warnCustomerWithTitle:@"提示" message:message cancleButtonTitle:cancelString sureBtnTitle:sureString  delegate:delegate];
}
+ (void)warnCustomerWithTitle:(NSString *)title message:(NSString *)message  cancleButtonTitle:(NSString *)cancelString sureBtnTitle:(NSString *)sureString delegate:(id<UIAlertViewDelegate>)delegate
{
    
    [[[UIAlertView alloc]initWithTitle:title message:message delegate:delegate cancelButtonTitle:cancelString otherButtonTitles:sureString, nil] show];
}
+(void)warnCustomerwithTitle:(NSString *)title afterDuration:(CGFloat)duration
{
    UIAlertView *al = [[UIAlertView alloc] initWithTitle:title message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
    [al show];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [al dismissWithClickedButtonIndex:0 animated:YES];
    });
}
@end
